package cn.sintang.mianshi;

import java.io.IOException;

/**
 * @author txy
 * @date 2017/11/29 11:02
 */
public class ExceptionHappenLine {

    public static void main(String[] args) throws Exception {
        whichLineExceptionThrow();
    }

    /**
     * 结果为4，在finally的地方抛出了异常
     * 执行顺序为2-6-8
     * @throws Exception
     */
    public static void whichLineExceptionThrow() throws Exception {
        try{                         //1
            throw new Exception("1");//2
        }catch (IOException e){      //3
            throw new Exception("2");//4
        }catch (Exception e) {       //5
            throw new Exception("3");//6
        }finally {                   //7
            throw new Exception("4");//8
        }
    }
}
